package com.ruoyi.module.purchaserecord.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.module.purchaserecord.mapper.BizPurchaseRecordMapper;
import com.ruoyi.module.purchaserecord.domain.BizPurchaseRecord;
import com.ruoyi.module.purchaserecord.service.IBizPurchaseRecordService;

/**
 * 产品购买记录Service业务层处理
 * 
 * @author zhaoxi
 * @date 2023-09-11
 */
@Service
public class BizPurchaseRecordServiceImpl implements IBizPurchaseRecordService 
{
    @Autowired
    private BizPurchaseRecordMapper bizPurchaseRecordMapper;

    /**
     * 查询产品购买记录
     * 
     * @param id 产品购买记录主键
     * @return 产品购买记录
     */
    @Override
    public BizPurchaseRecord selectBizPurchaseRecordById(Long id)
    {
        return bizPurchaseRecordMapper.selectBizPurchaseRecordById(id);
    }

    /**
     * 查询产品购买记录列表
     * 
     * @param bizPurchaseRecord 产品购买记录
     * @return 产品购买记录
     */
    @Override
    public List<BizPurchaseRecord> selectBizPurchaseRecordList(BizPurchaseRecord bizPurchaseRecord)
    {
        return bizPurchaseRecordMapper.selectBizPurchaseRecordList(bizPurchaseRecord);
    }

    /**
     * 新增产品购买记录
     * 
     * @param bizPurchaseRecord 产品购买记录
     * @return 结果
     */
    @Override
    public int insertBizPurchaseRecord(BizPurchaseRecord bizPurchaseRecord)
    {
        bizPurchaseRecord.setCreateTime(DateUtils.getNowDate());
        return bizPurchaseRecordMapper.insertBizPurchaseRecord(bizPurchaseRecord);
    }

    /**
     * 修改产品购买记录
     * 
     * @param bizPurchaseRecord 产品购买记录
     * @return 结果
     */
    @Override
    public int updateBizPurchaseRecord(BizPurchaseRecord bizPurchaseRecord)
    {
        bizPurchaseRecord.setUpdateTime(DateUtils.getNowDate());
        return bizPurchaseRecordMapper.updateBizPurchaseRecord(bizPurchaseRecord);
    }

    /**
     * 批量删除产品购买记录
     * 
     * @param ids 需要删除的产品购买记录主键
     * @return 结果
     */
    @Override
    public int deleteBizPurchaseRecordByIds(Long[] ids)
    {
        return bizPurchaseRecordMapper.deleteBizPurchaseRecordByIds(ids);
    }

    /**
     * 删除产品购买记录信息
     * 
     * @param id 产品购买记录主键
     * @return 结果
     */
    @Override
    public int deleteBizPurchaseRecordById(Long id)
    {
        return bizPurchaseRecordMapper.deleteBizPurchaseRecordById(id);
    }
}
